package com.study.practice.config;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;


/**
 * 定义计数跟踪切面
 */
@Aspect
@Component
public class TrackCounter {

    @Pointcut("execution(* com.study.practice.controller.TestStrReplace.testCounter(String)) && args(traceInfo)")
    public void performance(String traceInfo){}

    @Before("performance(traceInfo)")
    public void beforeTest(String traceInfo) {
        System.out.println("before test "+ traceInfo);
    }
}
